home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / THINKC / 4_0 / LIFE6__ / PROTO / P / PCOMMONL.H < prev    next >
Text File  |  1991-08-16  |  13KB  |  257 lines

  1. /*   PCommonLife6                                                         Common
  2.  
  3. Name:  PCommonLife6.h  
  4. Function:  Common for the Prototyper specific code.
  5. History: 8/16/91 Original by Prototyper 3.0
  6. */
  7.  
  8.  
  9.  
  10. /* ======================================================= */
  11.  
  12.  
  13.  
  14. /* ======================================================= */
  15.  
  16.  
  17.  
  18. /* Basic definitions */ 
  19. #define NIL        0L                                                          /* Used for empty pointers and handles */ 
  20.  
  21. /* User event definitions */ 
  22. #define UserEvent_None        0                                            /* No user events available */ 
  23. #define UserEvent_Open_Window    1                                    /* Open Window or modeless dialog */ 
  24. #define UserEvent_Close_Window    2                                   /* Close Window or modeless dialog */ 
  25. /* IDs 0 to 999 reserved for Prototyper, all others available for special use */ 
  26.  
  27. /* Menu list resource IDs */ 
  28. #define Res_Menu_Apple     256                                          /* Menu resource ID */ 
  29. #define MItem_About_Life     1
  30.  
  31. #define Res_Menu_File     257                                             /* Menu resource ID */ 
  32. #define MItem_New     1
  33. #define MItem_Open     2
  34. #define MItem_Close     4
  35. #define MItem_Save     5
  36. #define MItem_Save_As     6
  37. #define MItem_Revert_to_Saved     7
  38. #define MItem_Page_Setup     9
  39. #define MItem_Print     10
  40. #define MItem_Quit     12
  41.  
  42. #define Res_Menu_Edit     258                                            /* Menu resource ID */ 
  43. #define MItem_Undo     1
  44. #define MItem_Cut     3
  45. #define MItem_Copy     4
  46. #define MItem_Paste     5
  47. #define MItem_Clear     6
  48. #define MItem_Select_All     7
  49. #define MItem_Show_Clipboard     9
  50.  
  51. #define Res_Menu_Life_Stuff     259                                     /* Menu resource ID */ 
  52. #define MItem_Reset     1
  53. #define MItem_Continuous     2
  54.  
  55.  
  56. /* Window resource IDs, also controls grouped with the appropiate window */ 
  57.  
  58. #define Res_D_About_Life     257                                        /* Modal Dialog */ 
  59. #define Res_Dlg_Big_Deal     1                                            /* ...Button */ 
  60. /* Static text item   Static_Text is 2 */ 
  61.  
  62. #define Res_W_Life_4a     256                                            /* Window */ 
  63. #define Res_Ctrl_GO     255                                               /* ...Button */ 
  64. #define Res_Ctrl_Rect_hotspot1_1     257                             /* ...HotSpot */ 
  65. #define Res_Ctrl_Rect_hotspot1_2     258                             /* ...HotSpot */ 
  66. #define Res_Ctrl_Rect_hotspot1_3     259                             /* ...HotSpot */ 
  67. #define Res_Ctrl_Rect_hotspot1_4     260                             /* ...HotSpot */ 
  68. #define Res_Ctrl_Rect_hotspot1_5     261                             /* ...HotSpot */ 
  69. #define Res_Ctrl_Rect_hotspot1_6     262                             /* ...HotSpot */ 
  70. #define Res_Ctrl_Rect_hotspot1_7     263                             /* ...HotSpot */ 
  71. #define Res_Ctrl_Rect_hotspot1_8     264                             /* ...HotSpot */ 
  72. #define Res_Ctrl_Rect_hotspot2_1     265                             /* ...HotSpot */ 
  73. #define Res_Ctrl_Rect_hotspot2_2     266                             /* ...HotSpot */ 
  74. #define Res_Ctrl_Rect_hotspot2_3     267                             /* ...HotSpot */ 
  75. #define Res_Ctrl_Rect_hotspot2_4     268                             /* ...HotSpot */ 
  76. #define Res_Ctrl_Rect_hotspot2_5     269                             /* ...HotSpot */ 
  77. #define Res_Ctrl_Rect_hotspot2_6     270                             /* ...HotSpot */ 
  78. #define Res_Ctrl_Rect_hotspot2_7     271                             /* ...HotSpot */ 
  79. #define Res_Ctrl_Rect_hotspot2_8     272                             /* ...HotSpot */ 
  80. #define Res_Ctrl_Rect_hotspot3_1     273                             /* ...HotSpot */ 
  81. #define Res_Ctrl_Rect_hotspot3_2     274                             /* ...HotSpot */ 
  82. #define Res_Ctrl_Rect_hotspot3_3     275                             /* ...HotSpot */ 
  83. #define Res_Ctrl_Rect_hotspot3_4     276                             /* ...HotSpot */ 
  84. #define Res_Ctrl_Rect_hotspot3_5     277                             /* ...HotSpot */ 
  85. #define Res_Ctrl_Rect_hotspot3_6     278                             /* ...HotSpot */ 
  86. #define Res_Ctrl_Rect_hotspot3_7     279                             /* ...HotSpot */ 
  87. #define Res_Ctrl_Rect_hotspot3_8     280                             /* ...HotSpot */ 
  88. #define Res_Ctrl_Rect_hotspot4_1     281                             /* ...HotSpot */ 
  89. #define Res_Ctrl_Rect_hotspot4_2     282                             /* ...HotSpot */ 
  90. #define Res_Ctrl_Rect_hotspot4_3     283                             /* ...HotSpot */ 
  91. #define Res_Ctrl_Rect_hotspot4_4     284                             /* ...HotSpot */ 
  92. #define Res_Ctrl_Rect_hotspot4_52     285                                   /* ...HotSpot */ 
  93. #define Res_Ctrl_Rect_hotspot4_6     286                             /* ...HotSpot */ 
  94. #define Res_Ctrl_Rect_hotspot4_7     287                             /* ...HotSpot */ 
  95. #define Res_Ctrl_Rect_hotspot4_8     288                             /* ...HotSpot */ 
  96. #define Res_Ctrl_Rect_hotspot5_1     289                             /* ...HotSpot */ 
  97. #define Res_Ctrl_Rect_hotspot5_2     290                             /* ...HotSpot */ 
  98. #define Res_Ctrl_Rect_hotspot5_3     291                             /* ...HotSpot */ 
  99. #define Res_Ctrl_Rect_hotspot5_4     292                             /* ...HotSpot */ 
  100. #define Res_Ctrl_Rect_hotspot5_5     293                                /* ...HotSpot */ 
  101. #define Res_Ctrl_Rect_hotspot5_6     294                             /* ...HotSpot */ 
  102. #define Res_Ctrl_Rect_hotspot5_7     295                             /* ...HotSpot */ 
  103. #define Res_Ctrl_Rect_hotspot5_8     296                     /* ...HotSpot */ 
  104. #define Res_Ctrl_Rect_hotspot6_1     297                             /* ...HotSpot */ 
  105. #define Res_Ctrl_Rect_hotspot6_2     298                             /* ...HotSpot */ 
  106. #define Res_Ctrl_Rect_hotspot6_3     299                             /* ...HotSpot */ 
  107. #define Res_Ctrl_Rect_hotspot6_4     300                             /* ...HotSpot */ 
  108. #define Res_Ctrl_Rect_hotspot6_5     301                             /* ...HotSpot */ 
  109. #define Res_Ctrl_Rect_hotspot6_6     302                             /* ...HotSpot */ 
  110. #define Res_Ctrl_Rect_hotspot6_7     303                             /* ...HotSpot */ 
  111. #define Res_Ctrl_Rect_hotspot6_8     304                                     /* ...HotSpot */ 
  112. #define Res_Ctrl_Static_Text     313                                    /* ...String of text */ 
  113. #define Res_Ctrl_Static_Text2     314                                  /* ...String of text */ 
  114. #define Res_Ctrl_Static_Text3     315                                  /* ...String of text */ 
  115.  
  116.  
  117.  
  118. /* ======================================================= */
  119.  
  120.  
  121.  
  122. typedef struct UserEventRec{                                             /* User Event Record definition */
  123.     short    ID;                                                                 /* ID for the type of user event */
  124.     short    ID2;                                                               /* Optionally used, 2nd ID, sometimes used */
  125.     long    Data1;                                                             /* Optionally used, Extra data */
  126.     long    Data2;                                                             /* Optionally used, Extra data */
  127.     Handle    theHandle;                                                      /* Optionally used, Handle */
  128.     struct UserEventRec    **Next;                                       /* Handle of next event in the list */
  129. }UserEventRec,*UserEventPRec,**UserEventHRec;
  130.  
  131.  
  132. extern UserEventHRec UserEventList;                                   /* User Event record list start */
  133. extern EventRecord myEvent;                                             /* Event record for all events */
  134. extern Boolean WNE;                                                        /* WaitNextEvent trap is available */
  135. extern short SleepValue;                                                   /* Sleep value for Wait on events */
  136. extern Boolean doneFlag;                                                   /* Exit program flag */
  137. extern TEHandle theInput;                                                  /* Used in text edit selections */
  138. extern Rect tempRect;                                                     /* Temporary rect, not for long term use */
  139. extern Str255 sTemp;                                                     /* Temporary string, not for long term use */
  140. extern Boolean  HasColorQD;                                              /* Flag for Color QuickDraw being available */
  141. extern Boolean  HasFPU;                                                    /* Flag for Floating Point Math Chip being available */
  142. extern Boolean  InTheForeground;                                         /* Flag for running in MultiFinder foreground */
  143. extern short  tempChar;                                                    /*Temporary use character*/
  144.  
  145. extern MenuHandle    Menu_Apple;                                        /* Menu handle */
  146. extern MenuHandle    Menu_File;                                          /* Menu handle */
  147. extern MenuHandle    Menu_Edit;                                         /* Menu handle */
  148. extern MenuHandle    Menu_Life_Stuff;                                  /* Menu handle */
  149.  
  150. /* Variables for the modal dialog titled  "About Life" */
  151.  
  152. /* Window variables for the window titled  "Life 4a" */
  153. extern WindowPtr    WPtr_Life_4a;                                      /* Window pointer */
  154. extern ControlHandle    Ctrl_GO;                                         /* ...Button */
  155. extern ControlHandle    Ctrl_Rect_hotspot1_1;                         /* ...HotSpot or Rect*/
  156. extern Rect    HotRect_Rect_hotspot1_1;
  157. extern ControlHandle    Ctrl_Rect_hotspot1_2;                         /* ...HotSpot or Rect*/
  158. extern Rect    HotRect_Rect_hotspot1_2;
  159. extern ControlHandle    Ctrl_Rect_hotspot1_3;                         /* ...HotSpot or Rect*/
  160. extern Rect    HotRect_Rect_hotspot1_3;
  161. extern ControlHandle    Ctrl_Rect_hotspot1_4;                         /* ...HotSpot or Rect*/
  162. extern Rect    HotRect_Rect_hotspot1_4;
  163. extern ControlHandle    Ctrl_Rect_hotspot1_5;                         /* ...HotSpot or Rect*/
  164. extern Rect    HotRect_Rect_hotspot1_5;
  165. extern ControlHandle    Ctrl_Rect_hotspot1_6;                         /* ...HotSpot or Rect*/
  166. extern Rect    HotRect_Rect_hotspot1_6;
  167. extern ControlHandle    Ctrl_Rect_hotspot1_7;                         /* ...HotSpot or Rect*/
  168. extern Rect    HotRect_Rect_hotspot1_7;
  169. extern ControlHandle    Ctrl_Rect_hotspot1_8;                         /* ...HotSpot or Rect*/
  170. extern Rect    HotRect_Rect_hotspot1_8;
  171. extern ControlHandle    Ctrl_Rect_hotspot2_1;                         /* ...HotSpot or Rect*/
  172. extern Rect    HotRect_Rect_hotspot2_1;
  173. extern ControlHandle    Ctrl_Rect_hotspot2_2;                         /* ...HotSpot or Rect*/
  174. extern Rect    HotRect_Rect_hotspot2_2;
  175. extern ControlHandle    Ctrl_Rect_hotspot2_3;                         /* ...HotSpot or Rect*/
  176. extern Rect    HotRect_Rect_hotspot2_3;
  177. extern ControlHandle    Ctrl_Rect_hotspot2_4;                         /* ...HotSpot or Rect*/
  178. extern Rect    HotRect_Rect_hotspot2_4;
  179. extern ControlHandle    Ctrl_Rect_hotspot2_5;                         /* ...HotSpot or Rect*/
  180. extern Rect    HotRect_Rect_hotspot2_5;
  181. extern ControlHandle    Ctrl_Rect_hotspot2_6;                         /* ...HotSpot or Rect*/
  182. extern Rect    HotRect_Rect_hotspot2_6;
  183. extern ControlHandle    Ctrl_Rect_hotspot2_7;                         /* ...HotSpot or Rect*/
  184. extern Rect    HotRect_Rect_hotspot2_7;
  185. extern ControlHandle    Ctrl_Rect_hotspot2_8;                         /* ...HotSpot or Rect*/
  186. extern Rect    HotRect_Rect_hotspot2_8;
  187. extern ControlHandle    Ctrl_Rect_hotspot3_1;                         /* ...HotSpot or Rect*/
  188. extern Rect    HotRect_Rect_hotspot3_1;
  189. extern ControlHandle    Ctrl_Rect_hotspot3_2;                         /* ...HotSpot or Rect*/
  190. extern Rect    HotRect_Rect_hotspot3_2;
  191. extern ControlHandle    Ctrl_Rect_hotspot3_3;                         /* ...HotSpot or Rect*/
  192. extern Rect    HotRect_Rect_hotspot3_3;
  193. extern ControlHandle    Ctrl_Rect_hotspot3_4;                         /* ...HotSpot or Rect*/
  194. extern Rect    HotRect_Rect_hotspot3_4;
  195. extern ControlHandle    Ctrl_Rect_hotspot3_5;                         /* ...HotSpot or Rect*/
  196. extern Rect    HotRect_Rect_hotspot3_5;
  197. extern ControlHandle    Ctrl_Rect_hotspot3_6;                         /* ...HotSpot or Rect*/
  198. extern Rect    HotRect_Rect_hotspot3_6;
  199. extern ControlHandle    Ctrl_Rect_hotspot3_7;                         /* ...HotSpot or Rect*/
  200. extern Rect    HotRect_Rect_hotspot3_7;
  201. extern ControlHandle    Ctrl_Rect_hotspot3_8;                         /* ...HotSpot or Rect*/
  202. extern Rect    HotRect_Rect_hotspot3_8;
  203. extern ControlHandle    Ctrl_Rect_hotspot4_1;                         /* ...HotSpot or Rect*/
  204. extern Rect    HotRect_Rect_hotspot4_1;
  205. extern ControlHandle    Ctrl_Rect_hotspot4_2;                         /* ...HotSpot or Rect*/
  206. extern Rect    HotRect_Rect_hotspot4_2;
  207. extern ControlHandle    Ctrl_Rect_hotspot4_3;                         /* ...HotSpot or Rect*/
  208. extern Rect    HotRect_Rect_hotspot4_3;
  209. extern ControlHandle    Ctrl_Rect_hotspot4_4;                         /* ...HotSpot or Rect*/
  210. extern Rect    HotRect_Rect_hotspot4_4;
  211. extern ControlHandle    Ctrl_Rect_hotspot4_52;                       /* ...HotSpot or Rect*/
  212. extern Rect    HotRect_Rect_hotspot4_52;
  213. extern ControlHandle    Ctrl_Rect_hotspot4_6;                         /* ...HotSpot or Rect*/
  214. extern Rect    HotRect_Rect_hotspot4_6;
  215. extern ControlHandle    Ctrl_Rect_hotspot4_7;                         /* ...HotSpot or Rect*/
  216. extern Rect    HotRect_Rect_hotspot4_7;
  217. extern ControlHandle    Ctrl_Rect_hotspot4_8;                         /* ...HotSpot or Rect*/
  218. extern Rect    HotRect_Rect_hotspot4_8;
  219. extern ControlHandle    Ctrl_Rect_hotspot5_1;                         /* ...HotSpot or Rect*/
  220. extern Rect    HotRect_Rect_hotspot5_1;
  221. extern ControlHandle    Ctrl_Rect_hotspot5_2;                         /* ...HotSpot or Rect*/
  222. extern Rect    HotRect_Rect_hotspot5_2;
  223. extern ControlHandle    Ctrl_Rect_hotspot5_3;                         /* ...HotSpot or Rect*/
  224. extern Rect    HotRect_Rect_hotspot5_3;
  225. extern ControlHandle    Ctrl_Rect_hotspot5_4;                         /* ...HotSpot or Rect*/
  226. extern Rect    HotRect_Rect_hotspot5_4;
  227. extern ControlHandle    Ctrl_Rect_hotspot5_5;                         /* ...HotSpot or Rect*/
  228. extern Rect    HotRect_Rect_hotspot5_5;
  229. extern ControlHandle    Ctrl_Rect_hotspot5_6;                         /* ...HotSpot or Rect*/
  230. extern Rect    HotRect_Rect_hotspot5_6;
  231. extern ControlHandle    Ctrl_Rect_hotspot5_7;                         /* ...HotSpot or Rect*/
  232. extern Rect    HotRect_Rect_hotspot5_7;
  233. extern ControlHandle    Ctrl_Rect_hotspot5_8;                         /* ...HotSpot or Rect*/
  234. extern Rect    HotRect_Rect_hotspot5_8;
  235. extern ControlHandle    Ctrl_Rect_hotspot6_1;                         /* ...HotSpot or Rect*/
  236. extern Rect    HotRect_Rect_hotspot6_1;
  237. extern ControlHandle    Ctrl_Rect_hotspot6_2;                         /* ...HotSpot or Rect*/
  238. extern Rect    HotRect_Rect_hotspot6_2;
  239. extern ControlHandle    Ctrl_Rect_hotspot6_3;                         /* ...HotSpot or Rect*/
  240. extern Rect    HotRect_Rect_hotspot6_3;
  241. extern ControlHandle    Ctrl_Rect_hotspot6_4;                         /* ...HotSpot or Rect*/
  242. extern Rect    HotRect_Rect_hotspot6_4;
  243. extern ControlHandle    Ctrl_Rect_hotspot6_5;                         /* ...HotSpot or Rect*/
  244. extern Rect    HotRect_Rect_hotspot6_5;
  245. extern ControlHandle    Ctrl_Rect_hotspot6_6;                         /* ...HotSpot or Rect*/
  246. extern Rect    HotRect_Rect_hotspot6_6;
  247. extern ControlHandle    Ctrl_Rect_hotspot6_7;                         /* ...HotSpot or Rect*/
  248. extern Rect    HotRect_Rect_hotspot6_7;
  249. extern ControlHandle    Ctrl_Rect_hotspot6_8;                         /* ...HotSpot or Rect*/
  250. extern Rect    HotRect_Rect_hotspot6_8;
  251.  
  252.  
  253.  
  254. /* ======================================================= */
  255.  
  256.  
  257.